package com.qigao.mall.jdbc.mapper;

import com.qigao.mall.commons.dto.TradeDetailCondDto;
import com.qigao.mall.jdbc.model.TbBonusDetail;
import com.qigao.mall.jdbc.model.TbTradeDetail;
import com.qigao.mall.jdbc.model.TbTradeDetailEntity;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface TbTradeDetailMapper extends AbstractTbTradeDetailMapper{

    void insertBatch(List<TbTradeDetailEntity> tbTradeDetails);

    List<TbBonusDetail> selectUserTradeGroup(@Param("lastMonthStartDate") Date lastMonthStartDate, @Param("lastMonthEndDate") Date lastMonthEndDate, @Param("compNo")String compNo);

    List<TbTradeDetail> selectCompTrade(@Param("lastMonthStartDate") Date lastMonthStartDate, @Param("lastMonthEndDate") Date lastMonthEndDate);

    List<TbBonusDetail> selectCompTradeGroup(@Param("lastMonthStartDate") Date lastMonthStartDate, @Param("lastMonthEndDate")Date lastMonthEndDate);

    List<TbTradeDetail> selectPageByCond(TradeDetailCondDto tradeDetailCondDto);

    void updateBatch(List<TbTradeDetail> tbTradeDetails);

    TbTradeDetail  selectLastTradeDetailByUserNo(String userNo);

    void deleteByTradeNo(String tradeNo);

    int countByDateRegion(@Param("beginDate") String beginDate, @Param("endDate")String endDate);

    List<TbBonusDetail> selectUserLevelByCompNo(String compNo);
}